<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ page import="java.util.List" %>
<%@ page import="javax.jdo.PersistenceManager" %>
<%@ page import="javax.servlet.http.HttpSession" %>
<%@ page import="microarray.*" %>

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>GEO/MicroArray Analysis</title>

<style type="text/css">
body {

	font: 100% Verdana, Arial, Helvetica, sans-serif;

	background: #FFFFFB;
	
	width:1000px;

	margin: 20px; /* it's good practice to zero the margin and padding of the body element to account for differing browser defaults */

	padding: 0;

	text-align: Center; /* this centers the container in IE 5* browsers. The text is then set to the left aligned default in the #container selector */

	color: #000;

}

#header {
	text-align: left;
	padding: 5px;
	margin: 5px;
}

#outer{
	padding: 5px;
	
	margin: 5px;
}

#nav {
	padding-top: 10px;
	text-align: Left;
}

#tabs {

border-bottom: 0.1em solid #730;

margin: 0;

padding: 0;

}

#tabs li { 

display:inline; 

}

#tabs li a {
	
	border-top: .1em solid #730;

	border-left: .1em solid #730;
	
	border-right: .1em solid #730;
	
	text-decoration: none;
	
	padding: 0.1em 1em;
	
	background-color:#830;
	
	color: #fff;

}


#main #tabs li#main a, #experience #tabs li#experience a, #projects #tabs li#projects a, research #tabs li#research a, #calendar #tabs li#calendar a, #microarray #tabs li#microarray a{

padding: 0.1em 1em;

background-color:#FFFFF0;

color: #000;

}

#content
{	
text-align: Left;

border-bottom: .1em solid #730;

border-left: .1em solid #730;

border-right: .1em solid #730;

padding: 0.25em 1em;

background-color:#FFFFF0;

color: #000;
}


</style>

</head>



<body id="microarray">
    <div id="header">
        <h1>FRANCIS E. MARINO JR.</h1>
        
        <p>21 Marion St, Apartment 1, Cambridge MA, 02141<br />
        617/935-9659<br />
        <a href="mailto:frankmarinojr@frankmarinojr.com">frankmarinojr@frankmarinojr.com</a><br />
    	</p>
    </div>
    
	<div id="outer">
        <div id="nav">
            <ul id="tabs">
            
            <li id="main"><a href="http://frankmarinojr.com/index.htm">main</a></li>
            
            <li id="experience"><a href="http://frankmarinojr.com/experience.htm">experience</a></li>
                    
            <li id="projects"><a href="http://frankmarinojr.com/projects.htm">projects</a></li>
            
            <li id="research"><a href="http://frankmarinojr.com/research.htm">research</a></li>
            
            <li id="calendar"><a href="http://frankmarinojr.com/calendar.htm">calendar</a></li>
            
            <li id="microarray"><a href="http://geomnibus.appspot.com/">microarray</a></li>
            
            </ul> 
        </div>
        
        <div id="content" style="text-align:center;">
        
            <div id="intro">
                Welcome to the GEO Microarray Analysis. Please fill in fields as applicable. 
            </div>
            
          <div id="inputs"  style="width:600px;" >
                <form action="/search" method="get">
                    <div style="text-align: right;">
                        Query 1
                      <input name="termOne" type="text" tabindex="1" value="" size="60" maxlength="30" />
                    </div>
                    <div style="text-align: right;">
                        Query 2
                        <input name="termTwo" type="text" tabindex="2" value="" size="60" maxlength="30" />
                    </div>
              <div style="text-align: right;">
                        Max Results
                        <input name="retmax" type="text" tabindex="3" value="500" size="15" maxlength="30" />
                    </div>
                    <div  style="text-align: right;">
                        SortBy
                        <SELECT name="sortby"  tabindex="4" STYLE="width: 120px">
                        <OPTION SELECTED>author</OPTION> 
                        <OPTION>last+author </OPTION>
                        <OPTION>journal </OPTION>
                        <OPTION>pub+date</OPTION>
                        <OPTION>Weight </OPTION>
                        <OPTION>Name </OPTION>
                        <OPTION>Chromosome</OPTION>
                        </SELECT>
                    </div>
                    <div  style="text-align: right;">
                         Just display the studies <input type="radio" tabindex="5" name="job" value="display" checked> <br>
                         Compare (this may take a while)<input type="radio" tabindex="6" name="job" value="compare"> <br>
                    </div>
                    <div style="text-align: right;">
                        <input type="submit" value="Search" / tabindex="7">
                    </div>
                    <div style="text-align: right;">
                        Advanced Options
                    </div>
                    <div  style="text-align: right;">
                        Database
                        <input name="db" type="text" tabindex="8" value="gds" size="20" maxlength="30" />
                    </div>
                    <div style="text-align: right;">Days to search (backwards)
                      <input name="reldate" type="text" tabindex="9" size="15" maxlength="30" />
                    </div>
                </form>
            </div>
            
         	<div id="results" style="width:100%; text-align:left;">
            	<% 
            	if(session.getAttribute("job") != null && ((String)(session.getAttribute("job"))).equals("display")){
            	%>
	           	 	<div id="results1" style="float: left; width:50%; margin:=5px; ">
	                    <% 
	                    request.getSession(true);
	                    
	                    List<String> idsOne =  (List<String>)session.getAttribute("idsOne");
	                    ESummary summariesOne = (ESummary)session.getAttribute("summariesOne"); 

	                    if (idsOne != null && summariesOne != null){
	                    %>
	                        <div id="outputs" style="border-top: .1em solid #730;" >
	                        	Query: <%= (String)(session.getAttribute("queryOne")) %>
	                        <%
	                            for (String id : idsOne){
	                        %>
	                                <div >
	                                <br>
	                                ID: <%= id%><br>
	                                Title: <%= summariesOne.getValue(id, "title") %> <br>
	                                Description: <%= summariesOne.getValue(id, "description") %> <br>
	                                </div>
	                        <%
	                            }
	                        %>
	                        </div>
	                    <%
	                    }
	                    %>
	                </div>
	                
	    			<div id="results2" style="float: left; width:50%; margin:=5px; ">
	                    <%
	                    List<String> idsTwo =  (List<String>)session.getAttribute("idsTwo");
	                    ESummary summariesTwo = (ESummary)session.getAttribute("summariesTwo"); 
						
	                    if (idsTwo != null && summariesTwo != null){
	                    %>
	                        <div id="outputs" style="border-top: .1em solid #730;" >
	                        	Query: <%= (String)(session.getAttribute("queryTwo")) %>
	                        <%
	                            for (String id : idsTwo){
	                        %>
	                                <div >
	                                <br>
	                                ID: <%= id%> <br>
	                                Title: <%= summariesTwo.getValue(id, "title") %> <br>
	                                Description: <%= summariesTwo.getValue(id, "description") %> <br>
	                                </div>
	                        <%
	                            }
	                        %>
	                        </div>
	                    <%
	                    }
	                    %>
	            	</div> 

					<div style="clear: both;"> </div>
	              <%
	              } else {
	              %>  
	              	<div id="comparison">
	              		<%= (String)(session.getAttribute("rdSize"))%>
	              	</div>
	              <%
	              }
	              %>
        	</div>
        </div>
        <div class="notice">
            <div id="notice" style="text-align: left; border: 1em 0em 1em 0em">
                <img src="http://code.google.com/appengine/images/appengine-noborder-120x30.gif" 
                alt="Powered by Google App Engine" /> 
                <p>This project is under development for CS697 with 
                Jun Suzuki at UMass Boston. Frank Marino has no affiliation with PubMed or GEO.</p>
                <p>Except as otherwise <a href="http://code.google.com/policies.html#restrictions">noted</a>,
                the content of this page is licensed under the <a rel="license"
                href="http://creativecommons.org/licenses/by/3.0/">Creative Commons
                Attribution 3.0 License</a></p>
            </div>
        </div>
    </div>
</body>
</html>